<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%><%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<tiles:insertDefinition name="dialog-layout">
	<tiles:putAttribute name="head">
		<script type="text/javascript">
			$(function() {
				$("form").Validform({
					ajaxPost : true,
					tiptype : ValidUtils.siblingTip,
					callback : function(data) {
						helper.showMsg(data, {
							okHandler : function() {
								art.dialog.data("success", true);
								art.dialog.close();
							}
						});
					}
				});
			});
		</script>
	</tiles:putAttribute>
	<tiles:putAttribute name="mainBody">
		<form action="doSetCourseInType" method="post">
			<input type="hidden" value="${courseType.id}" name="typeId" />
			<table class="table table-hover table-striped">
				<s:iterator value="courses" var="course">
					<tr>
						<td><label class="checkbox">
								<input value="${course.id}" type="checkbox" name="courseId" <s:if test="id in #courseType.courses.{id}">checked="checked"</s:if> />${course.name}(${course.title})
							</label></td>
					</tr>
				</s:iterator>
			</table>
			<div>
				<button class="btn btn-primary">提交</button>
			</div>
		</form>
	</tiles:putAttribute>
</tiles:insertDefinition>